Public Class DocentesGrid

    Private Sub mnuAgregar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuAgregar.Click


        DocenteForm.operacion = "Alta"

        DocenteForm.Show()
    End Sub

    Private Sub mnuEliminar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuEliminar.Click
        DocenteForm.operacion = "Elimina"
        DocenteForm.indice = DataGridView1.CurrentRow.Index

        LlenarForm1()

        DocenteForm.Show()
    End Sub

    Private Sub mnuEditar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuEditar.Click
        DocenteForm.operacion = "Modifica"
        DocenteForm.indice = DataGridView1.CurrentRow.Index


        LlenarForm1()

        DocenteForm.Show()
    End Sub

    Private Sub mnuSalir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSalir.Click
        Me.Close()
    End Sub

    Private Sub LlenarForm1()
        DocenteForm.TextBox1.Text = DataGridView1.CurrentRow.Cells(0).Value.ToString
        DocenteForm.TextBox2.Text = DataGridView1.CurrentRow.Cells(1).Value.ToString
        DocenteForm.TextBox3.Text = DataGridView1.CurrentRow.Cells(2).Value.ToString
        DocenteForm.TextBox4.Text = DataGridView1.CurrentRow.Cells(3).Value.ToString

    End Sub

    Private Sub DocentesGrid_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DataGridView1.DataSource = docentes_list
    End Sub
End Class
